<template>
    <div>
        <h1>数据初始化加载</h1>
        <ul>
            <li v-for="user in users" :key="user.id">{{ user.name }}</li>
        </ul>
    </div>
</template>


<script setup lang="ts">
import { ref, onMounted } from 'vue'


interface Iuser {
    id: string
    name: string
}
const users = ref<Iuser[]>([])

onMounted(async () => {
    const response = await fetch('https://jsonplaceholder.typicode.com/users')
    users.value = await response.json()
})
</script>

<style></style>